Skip to content

Fix "defautlUrl" variable name typo in ensureLocalRedirectUrl#3697

Open
J8118 wants to merge 1 commit intoShopify:mainfrom
J8118:fix/defautlurl-variable-typo
Open

Fix "defautlUrl" variable name typo in ensureLocalRedirectUrl#3697
J8118 wants to merge 1 commit intoShopify:mainfrom
J8118:fix/defautlurl-variable-typo

Conversation

@J8118
Copy link
Copy Markdown

@J8118 J8118 commented Apr 10, 2026

Summary

In get-redirect-url.ts line 52, the local variable defautlUrl is a transposition typo of defaultUrl. The typo is used consistently within the function (lines 52, 55, 61, 63) so it doesn't cause a runtime bug, but it could cause confusion when reading or maintaining the code.

File changed:

  • packages/hydrogen/src/utils/get-redirect-url.ts (lines 52, 55, 61, 63)

Before:

const defautlUrl = buildURLObject(requestUrl, defaultUrl);
const toUrl = redirectUrl
  ? buildURLObject(requestUrl, redirectUrl)
  : defautlUrl;
// ...
return defautlUrl.toString();

After:

const parsedDefaultUrl = buildURLObject(requestUrl, defaultUrl);
const toUrl = redirectUrl
  ? buildURLObject(requestUrl, redirectUrl)
  : parsedDefaultUrl;
// ...
return parsedDefaultUrl.toString();

Renamed the transposed variable name defautlUrl to parsedDefaultUrl
to avoid shadowing the defaultUrl parameter and fix the typo.
@J8118 J8118 requested a review from a team as a code owner April 10, 2026 09:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant